package defaultpkg;
import javax.ws.rs.ext.ContextResolver;
import javax.ws.rs.ext.Provider;
import javax.xml.bind.JAXBContext;
import com.sun.jersey.api.json.JSONConfiguration;
import com.sun.jersey.api.json.JSONJAXBContext;
@Provider
public class JsonCtxResolver implements ContextResolver<JAXBContext>  {
	private JAXBContext context;
	private Class[] types = {
			com.rest.core.Credentials.class,
			com.rest.core.TransactionMessage.class,
			com.razorthink.runtime.query.Query.class,
			com.razorthink.runtime.query.Result.class,
			com.razorthink.runtime.query.Row.class,
			com.razorthink.runtime.query.BatchResult.class,
			com.razorthink.runtime.query.QueryResult.class
			};
	public JsonCtxResolver() throws Exception {
		this.context = new JSONJAXBContext(JSONConfiguration.natural().build(),types);
	}
	public JAXBContext getContext(Class c) {
		System.out.println(c.getCanonicalName());
		return(context);
	}
}
